class @ProfileRatedBooksModel extends Backbone.Model
    @Column: 'Name'
    @Direction: 0
    @BookViewType: 1
    defaults:
        Login: ''
        UserId: ''
        Page: 1
        Column: "Name"
        Direction: 0
        BookViewType: 1

    setStaticProperty: (attributeName, attributeValue) ->
        if attributeName == "Column"
            ProfileRatedBooksModel.Column = attributeValue
            @attributes.Column = attributeValue

        if attributeName == "Direction"
            ProfileRatedBooksModel.Direction = attributeValue
            @attributes.Direction = attributeValue
        
        if attributeName == "BookViewType"
            ProfileRatedBooksModel.BookViewType = attributeValue
            @attributes.BookViewType = attributeValue

    url: ->
        url = SiteMap.Profile.RatedBooks + "/" + @attributes.Login
        url += "?login=" + @attributes.Login
        url += "&page=" + @attributes.Page
        url += "&Column=" + ProfileRatedBooksModel.Column
        url += "&Direction=" + ProfileRatedBooksModel.Direction
        url += "&viewType=" + ProfileRatedBooksModel.BookViewType
        return url
    
    parse: (response) ->
        attrs = {}
        attrs.Items = response
        return attrs  